package lab02.test12;
//定义长方形的长，宽属性
public class Rectangle extends  Shape{
    double width;
    double height;
    double area;
    double perimeter;

  public Rectangle(){

  }
  public  Rectangle(double width,double height){
      this.height = height;
      this.width = width;
  }
  @Override
    public void getPerimeter(){
         perimeter = 2*(width+height);
         System.out.println("长方形的周长："+perimeter);
    }
    @Override
    public void getArea(){
        area = width*height;
        System.out.println("长方形的面积："+area);
    }

}
